#ifndef __AS5047P_H__
#define __AS5047P_H__

#include "main.h"
#include "spi.h"
#include <stdbool.h>
#include "gpio.h"

typedef struct AS5047P_Handle AS5047P_HandleTypeDef;

struct AS5047P_pf
{
	float (*read)(AS5047P_HandleTypeDef*);
};

struct AS5047P_Handle
{
	float angle;
	GPIO_TypeDef *CS_GPIOx;
	uint16_t CS_GPIO_Pin;
	SPI_HandleTypeDef *hspi;
	struct AS5047P_pf *pf;
};

void AS5047P_Init(AS5047P_HandleTypeDef *, SPI_HandleTypeDef *hspi, GPIO_TypeDef *CS_GPIOx, uint16_t CS_GPIO_Pin);


#endif
